home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
doors_2
/
twview91.zip
/
MULTPATH.INC
< prev
next >
Wrap
Text File
|
1992-03-11
|
1KB
|
49 lines
const
MaxMPS = 10;
Incomplete = true;
type
DistanceTable = array [1..MaxMPS, 1..MaxMPS] of integer;
SectorVector = array [1..MaxMPS] of sectorindex;
procedure GetDistanceTableData( n : integer;
var D : distanceTable;
var V : SectorVector );
{ read n sectors, and specify the n^2 distances between pairs in D }
var
i, j : 1..MaxMPS;
begin
write('Please enter your sector values: ');
for i := 1 to n do
V[i] := getsector;
for i := 1 to n do
for j := 1 to n do
if i <> j then
D[ i, j ] := FixPath( V[i], V[j] );
for i := 1 to n do
D[i,i] := 0;
end;
procedure MultiPassSector;
{ accept a small number of sectors, and find the best path that hits these
sectors (possibly returning to the base sector}
var
Table : DistanceTable;
targets : SectorVector;
numsectors : integer;
begin
if incomplete then
writeln('Not Yet Implemented.')
else
begin
repeat
write('How many targets? (0 to abort) ');
readln( NumSectors );
until (NumSectors >= 0) and (NumSectors <= MaxMPS );
if NumSectors > 0 then
begin
GetDistanceTableData( NumSectors, Table, targets );
end;
end; {done}
end;